package com.zz.hhbl.ui.ai

import com.zz.framework.core.base.BaseFragment
import com.zz.framework.core.ext.finish
import com.zz.framework.core.ext.loadUrl
import com.zz.framework.core.ext.onClick
import com.zz.framework.core.ext.toLanguage
import com.zz.framework.core.ext.viewBinding
import com.zz.framework.core.utils.language.Strings
import com.zz.hhbl.R
import com.zz.hhbl.config.GlobalCache
import com.zz.hhbl.databinding.FragmentChangeAiBinding
import com.zz.hhbl.entity.SpotInfoEntity

/**
 * Copyright © 2025 zhun All rights reserved.
 * Created by ZhaoZhun on 2025/3/11 14:49.
 * @author: ZhaoZhun 1820022519@qq.com
 * @version: V1.0
 */
class ChangeAiFragment: BaseFragment(R.layout.fragment_change_ai) {
    val binding by viewBinding<FragmentChangeAiBinding>()
    override fun initView() {
        super.initView()
        val mSpotInfo: SpotInfoEntity? = GlobalCache.getSpotInfo()
        mSpotInfo?.welcomeData?.firstOrNull()?.let {
            binding?.ivBackground?.loadUrl(it.url.orEmpty())
        }
        binding?.apply {
            btnBack.text = Strings.返回.toLanguage()
            btnBack.onClick {
                finish()
            }
        }
    }
}